Grammars

PreviousUpNext

A File Format specification can include a grammar definition, used for syntax highlighting, and to help define differences that are important vs. unimportant.

For example, our standard file format for C/C++ source code includes a grammar that recognizes keywords, comments, and literal strings.  By flagging differences in comments as unimportant, you can better concentrate on important differences.

A grammar definition in BC3 is fairly simplistic.  It does not support nested or context-specific definitions, so it doesn't handle tagged languages like HTML and PHP very well.  On the other hand, it is a big step up from BC2's functionality.

To edit a grammar, select Tools > File Formats and find the appropriate File Format.  Select the Grammar tab and edit the grammar items.